"""
Contains the song element of our library

/file
/author Guillaume
/date november 25th, 2012
"""

from pkLibraryElement import pkLibraryElement

class pkSong(pkLibraryElement):
	""" Song element, base of our library """

	def __init__(self, tags, db_id):
		pkLibraryElement.__init__(self, tags, db_id)


	file_path = property(pkLibraryElement.get_tag("file_path")
	artist = property(pkLibraryElement.get_tag("artist")
	album = property(pkLibraryElement.get_tag("album")
	genre = property(pkLibraryElement.get_tag("genre")
	dick = property(pkLibraryElement.get_tag("disk")
	track = property(pkLibraryElement.get_tag("track")



class pkSongGroup(pkLibraryElement):
	""" SuperClass of groups of song """

	def __init__(self, tags, db_id):
		self._song_list = []


	def append(self, song):
		""" Insert a pkSong in the song group """

		try:
			self._valid_song(song)
		except TypeError as e:
			print("Error:" , e)
		else:
			self._song_list.append(song)
	   

	def _get_song_list():
		cloned_song_list = list(self._song_list)
		return cloned_list


	song_list = property(_get_song_list)


if __name__ == "__main__":
	pass
